package com.erb.service.llb.impl;

import com.erb.entity.Advertisement;
import com.erb.mapper.AdvertisementMapper;
import com.erb.service.llb.IAdvertisementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;


/**
 * 广告
 */
@Transactional
@Service
public class AdvertisementServiceImpl implements IAdvertisementService {

	@Autowired
	AdvertisementMapper advertisementMapper;

	@Override
	public int updateAdvertisement(Advertisement advertisement) {
		return advertisementMapper.updateAdvertisement(advertisement);
	}

	@Override
	public int updateAdvertisementStatus(int id, boolean isShow) {
		return advertisementMapper.updateAdvertisementStatus(id, isShow);
	}

	@Override
	public int addAdvertisement(Advertisement advertisement) {
		return advertisementMapper.addAdvertisement(advertisement);
	}

	@Override
	public int deleteAdvertisement(int id) {
		return advertisementMapper.deleteAdvertisement(id);
	}

	@Override
	public Advertisement findAdvertisementById(int id) {
		return advertisementMapper.findAdvertisementById(id);
	}

	@Override
	public void updateStatusTask() {
		advertisementMapper.updateStatusTask();
	}
}
